package pers.ree.demo.concurrent;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicDemo {

    public static void main(String[] args) {
        AtomicDemo ad = new AtomicDemo();
        ad.atomicIntegerDemo1();
    }

    public void atomicIntegerDemo1() {
        AtomicInteger ai = new AtomicInteger(123);
        int i = ai.incrementAndGet();
        System.out.println(i);
        i = ai.getAndIncrement();
        System.out.println(i);
        i = ai.get();
        System.out.println(i);
    }
}
